package com.woody.aggregate.shop.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Optional;

/**
 * &copy; All rights Reserved
 * 商圈配置，主门店显示状态枚举
 * @author wénkǎi.zhāng 2025-04-11
 */
@Getter
@RequiredArgsConstructor
public enum ParentShopShowStatusEnum {
    /**
     * 不显示
     */
    HIDDEN(0),

    /**
     * 显示
     */
    SHOW(1);

    /**
     * 主门店显示状态
     */
    private final Integer status;

    /**
     * 根据状态获取展示状态枚举
     *
     * @param showStatus
     * @return
     */
    public static Optional<ParentShopShowStatusEnum> fromType(Integer showStatus) {
        for (ParentShopShowStatusEnum value : values()) {
            if (value.getStatus().equals(showStatus)) {
                return Optional.of(value);
            }
        }

        return Optional.empty();
    }
}
